import * as PIXI from 'pixi.js'
import { setPixi } from '@renderer/store/modules/usePixiStore'
import useDiyStore from '@renderer/store/modules/useDiyStore'
import { nameFont } from '@renderer/utils/setting'
import useMagic from '@renderer/store/modules/useMagicStore'
export default (): PIXI.Container<PIXI.ContainerChild> => {
  const diyStore = useDiyStore()
  const container = new PIXI.Container()
  const name = ''
  const nameArr = name.split('')
  const nameSetting = nameFont(nameArr.length)
  nameArr.forEach((item, index) => {
    const text = new PIXI.Text({
      text: item,
      alpha: 0.8,
      style: {
        fontFamily: 'RZFont',
        fontSize: nameSetting.fontSize,
        fill: 0xffffff,
        align: 'center',
        dropShadow: {
          alpha: 0.55,
          distance: 3,
        },
      },
    })
    text.anchor.set(0.5)
    text.position.set(0, 30 - 256 / 2 + nameSetting.startY + index * nameSetting.lineSize)
    container.addChild(text)
  })
  container.scale.set(0.7)
  container.position.set(22 - useMagic().PICTURE_SCOPE / 2, (256 + 44 - 490) / 2 - 5)
  setPixi(container.uid, container)
  diyStore.setUidMap('name', container.uid)
  return container
}
